﻿@using BootstrapBlazor.Components


@if (AlarmMsg is { Count: > 0 })
{
    <Divider/>
    <div class="row g-3">
        @foreach (var msg in AlarmMsg)
        {
            <div class="col-6 col-sm-4 col-md-3 col-lg-1">
                <Button OnClick="@(() => BtnComfimAlarm(msg.Key))" Color="Color.Primary">
                    <span>
                        <i class="fa-solid fa-check"></i>
                    </span>
                </Button>
            </div>
            <div class="col-6 col-sm-4 col-md-3 col-lg-1">
                <Button OnClick="@(() => BtnHiddenAlarm(msg.Key))" Color="Color.Danger">
                    <span>
                        <i class="fa-solid fa-eye-slash"></i>
                    </span>
                </Button>
            </div>
            <div class="col-6 col-sm-4 col-md-6 col-lg-10">
                <p> @msg.Value </p>
            </div>
        }
    </div>
}
else
{
    if (AlarmNums == 0)
    {
        <p> 没有报警信息 </p>
    }
    else
    {
        <p>共有 @AlarmNums 报警信息被隐藏 </p>
    }
}

@* 报警相关的操作 *@
@if (AlarmNums > 0)
{
    <Divider />
    <div class="row g-3">
        <div class="col-6 col-sm-4 col-md-3 col-lg-auto badge-widget">
            <Button class="apple-btn" OnClick="@(() => BtnComfimAlarm(Guid.Empty))" Color="Color.Primary">
                <span>确认所有报警</span>
                <Badge Color="Color.Info">@AlarmNums</Badge>
            </Button>
        </div>
        <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
            <Button class="apple-btn" OnClick="@(() => BtnHiddenAlarm(Guid.Empty))" Color="Color.Danger">
                <span>
                    隐藏所有报警
                </span>
            </Button>
        </div>
        <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
            <Button class="apple-btn" OnClick="BtnShowAllAlarm" Color="Color.Success">
                <span>
                    显示所有报警
                </span>
            </Button>
        </div>
    </div>    
}



